package com.echo.im.engin.netty.processor.preprocessor.support;


import com.echo.im.common.dto.MessageDTO;
import com.echo.im.engin.netty.processor.preprocessor.MessageInPreprocessor;
import org.springframework.stereotype.Component;

/**
 * @author: echo
 * @time: 2024-08-22
 */
@Component
public class ACKMessageInPreprocessor implements MessageInPreprocessor {

    @Override
    public void doPreprocess(MessageDTO messageDTO) {
        messageDTO.setIsAnonymous(false);
        messageDTO.setIsNeedId(false);
        messageDTO.setIsNeedOfflineStore(false);
        messageDTO.setIsNeedStore(false);
        messageDTO.setIsNeedACK(false);
        messageDTO.setIsNeedSendToSelf(false);
    }

    @Override
    public Boolean support(Integer code) {
        return code.toString().startsWith("4");
    }

}
